﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    abstract class MenuItem
    {
        protected string name { get; private set; }

        public MenuItem(string name)
        
        {
            this.name = name;
        }

        abstract public void PrintToConsole();

    }
    class Beverage : MenuItem
    {
        private decimal small;
        private decimal medium;
        private decimal large;
        public Beverage(decimal small, decimal medium,
            decimal large, string name) : base(name)
        { Small = small; }

        public decimal Small
        {
            get
            { return small; }
            set
            {
                if (value <= 0) throw new ArgumentException();
                small = value;
            }
        }
        public decimal Medium
        {
            get
            { return medium; }
            set
            {
                if (value <= 0) throw new ArgumentException();
                medium = value;
            }
        }
        public decimal Large
        {
            get
            { return large; }
            set
            {
                if (value <= 0) throw new ArgumentException();
                large = value;
            }
        }
    public override void  PrintToConsole()
            {
            Console.WriteLine("{0} - Small:{1};Medium:{2};Large:{3}", name,Small,Medium,Large);
            }

    }

    class Snack : MenuItem
    {
        private decimal price;

        public Snack(decimal price, string name):base(name)
        {

        }

        public decimal Price
        { get
            { return price; }
            set

            { price = value; }
        }

        public override void PrintToConsole()
        {
            Console.WriteLine("{ 0} - {1}", name, Price);
        }


    }
}
